home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / xmasspak / askgus / askgus.asm next >
Encoding:
Assembly Source File  |  1995-06-08  |  3.1 KB  |  142 lines

  1. ;
  2. ;  ASKGUS-Routine v2.0
  3. ;
  4. ;  Public Release!!!!
  5. ;
  6. ;  brought to you by Capella of Escape
  7. ;
  8. ;  Use this way of locating the GUS-settings instead of hardware-testing!!!!
  9. ;
  10. ;  cap/esc
  11. ;
  12.  
  13.  
  14. ideal
  15. model small
  16. p386n
  17. stack 256
  18.  
  19. assume cs:coding
  20.  
  21. segment  coding
  22.  
  23. gusport         dw 0
  24.  
  25. start:          mov ax,[es:2ch]
  26.                 mov es,ax
  27.                 
  28.                 mov ax,0003h
  29.                 int 10h
  30.  
  31.                 mov ax,data1
  32.                 mov ds,ax
  33.                 assume ds:data1
  34.  
  35.                 call askgus
  36.                 cmp [cs:gus],1
  37.                 je warte1
  38.                 mov ah,09h
  39.                 mov dx,offset gus2
  40.                 int 21h
  41.                 jmp warte
  42.  
  43. warte1:         mov ah,09h
  44.                 mov dx,offset gus1
  45.                 int 21h
  46.                 
  47.                 call askport
  48.                 
  49.                 mov dx,0b800h
  50.                 mov es,dx
  51.                 assume es:0b800h
  52.  
  53.                 mov [es:0000],al
  54.                 mov [es:0002],ah
  55.                 mov [byte es:0004],"0"
  56.  
  57. warte:          in al,60h
  58.                 cmp al,01h
  59.                 jne warte
  60.  
  61.                 mov ax,4c00h
  62.                 int 21h
  63.  
  64. gus             db 0
  65. askgus:         xor si,si
  66.                 
  67. newcheck:       mov al,[es:si]
  68.                 cmp al,"U"
  69.                 jne checknext
  70.                 mov al,[es:si+1]
  71.                 cmp al,"L"
  72.                 jne checknext
  73.                 mov al,[es:si+2]
  74.                 cmp al,"T"
  75.                 jne checknext
  76.                 mov al,[es:si+3]
  77.                 cmp al,"R"
  78.                 jne checknext
  79.                 mov al,[es:si+4]
  80.                 cmp al,"A"
  81.                 jne checknext
  82.                 mov al,[es:si+5]
  83.                 cmp al,"S"
  84.                 jne checknext
  85.                 mov al,[es:si+6]
  86.                 cmp al,"N"
  87.                 jne checknext
  88.                 mov al,[es:si+7]
  89.                 cmp al,"D"
  90.                 jne checknext
  91.                 mov al,[es:si+8]
  92.                 cmp al,"="
  93.                 jne checknext
  94.  
  95.                 mov [cs:gus],1
  96.                 ret
  97.  
  98. checknext:      inc si
  99.                 cmp si,2000
  100.                 jne newcheck
  101.                 ret
  102.  
  103. askport:        mov bx,210h
  104.                 mov ax,[es:si+9]
  105.                 cmp ax,"21"
  106.                 je portfound
  107.                 add bx,10h
  108.                 cmp ax,"22"
  109.                 je portfound
  110.                 add bx,10h
  111.                 cmp ax,"23"
  112.                 je portfound
  113.                 add bx,10h
  114.                 cmp ax,"24"
  115.                 je portfound
  116.                 add bx,10h
  117.                 cmp ax,"25"
  118.                 je portfound
  119.                 add bx,10h
  120.                 cmp ax,"26"
  121.                 je portfound
  122.                 mov [cs:gus],0
  123.                 ret
  124.  
  125. portfound:      mov [cs:gus],1
  126.                 mov [cs:gusport],bx
  127.                 ret
  128.  
  129. ends  coding
  130.  
  131. segment  data1
  132.  
  133. gus1            db 13,10,"GUS found!$"
  134. gus2            db 13,10,"GUS not found!$"
  135.  
  136. ends  data1
  137.  
  138. end start
  139.  
  140.  
  141.  
  142.